<div class="threads">
	<a class="back-forum" href="/org/view/<?php echo $orgname ?>/forum">&lt;&lt;Back to Forum Index</a>
	<h2 class="heading" ><?php View::show($threads[0]['title'])?></h2>
<?php if( count($threads) === 0 ): ?>
	No threads yet.
<?php endif; ?>
<?php foreach($threads as $row):?>
	<div class="thread">
<?php 	if( $isAdmin ) : ?>
		<div class="delete">(<a href="/org/view/<?php echo $orgname ?>/thread/delete/<?php View::show($row['thread_id'])?>">Delete</a>)</div>
<?php 	endif; ?>
		<div class="title"><a href="/org/view/<?php echo $orgname ?>/thread/view/<?php View::show($row['thread_id'])?>"><?php View::show($row['thtitle'])?></a></div>
		<div>
			<div class="lastpost-date"><span class="label">Last posted on:</span> <?php View::show(date('l, dS \of F Y h:i:sa', strtotime($row['date']) + 8*3600)) ?></div>
			<div class="views">Views:<?php View::show($row['view_no'])?></div>
			<div class="replies">Replies:<?php View::show($row['reply_no'])?></div>
		</div>
		<div class="lastpost-author"><span class="label">by:</span><?php View::show( ucwords( strtolower( $row['lastname'])))?>, <?php View::show(ucwords( strtolower( $row['firstname'])))?> 
						<?php View::show(ucwords( strtolower( $row['middlename']{0} )))?>.</span></div>
	</div>
<?php endforeach ; ?>
<?php if( $isMember ) : ?>
	<div class="add">(<a href="/org/view/<?php echo $orgname ?>/thread/new/<?php echo $forumid ?>">Post new topic</a>)</div>
<?php endif; ?>
</div>